
<%@page import="cn.com.dhcc.app.core.CoreEnv.CoreInitCtx"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<%@ include file="/WEB-INF/view/common/css_js_ztree.jsp"%>
<script type="text/javascript">
	$(function() {
		$.checkBoxInit("status", '${fn:join(paramValues.status,', ')}'
				.split(','));
	});
	function search(form) {
		$(form).appendPagerParaStr();
		return true;
	}
	function formSubmit(){
	   $("#searchForm").submit();
	}
	/**
	 * 设置iframe高度
	 */
	function setIframeHeight(iframe) {
		if (iframe) {
			var iframeWin = iframe.contentWindow
					|| iframe.contentDocument.parentWindow;
			if (iframeWin.document.body) {
				iframe.height = 0;
				iframe.height = iframeWin.document.documentElement.scrollHeight
						|| iframeWin.document.body.scrollHeight;
				iframe.height = parseInt(iframe.height) + 24;
			}
		}
	};
	/**
	 * 删除权限
	 */
	function rightDel(rightId,rightName){
		ui.confirm('确认删除权限['+rightName+']？',function(){
		    $.ajax({
		           type: "POST",
		           dataType:"json",
		           cache: false,
		           url: _ctx+"/pub/sysmgr/authmgr/rel_del_right.do?id="+rightId,
		           beforeSend : function(){
		           },
		           success: function(resp){
		        	   if(resp.status == '1'){
						   ui.msg(resp.msg, 1);
						   ui.go(location.href);
					   }else{
						   ui.msg(resp.msg, 0);
					   }
		           },
		           error:function(){
		               ui.msg( '请求发送失败！',0 );
		           }
		    });
		});
	}
</script>
</head>
<body onresize="Javascript:setIframeHeight(document.getElementById('content'))">
	<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
			<div class="main-content">
				<iframe id="content" name="content" onload="Javascript:setIframeHeight(this)" frameborder="0"
						scrolling="auto" width="100%"  src="${ctx}/pub/welcome_content.do">
				</iframe>
			</div>
		</div>
	</div>
	
	<div id="toIframeModal" class="modal fade" role="dialog" tabindex="-1" aria-labelledby="查看" aria-hidden="false">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class='widget-header widget-header-small'><h5 class='smaller'> Show Modal In Parent Or Top Body</h5></div>
				<div id="toIframeDiv"></div>
			</div>
		</div>
	</div>
	
	<script language="javascript" type="text/javascript">
		$(document).ready(function () {
			$('#sidebar li').click(function(e) {
				if($(this)[0].getElementsByTagName("ul").length ? false : true){
					$('#sidebar li').removeClass('active open');
					$(this).addClass("active").parents().addClass("active open");
					setIframeHeight(document.getElementById("content"));
				}
			});
		});
		
		$("#sidebar>ul>li:nth-child(2)").addClass("active").parents().addClass("active open");
		
		/**
		 * selector     : modal的ID
		 * html         : modal中的HTML
		 * hiddenByClick: 点击窗口外的区域是否隐藏模态框
		 */
		function iframeModal(selector, html, hiddenByClick) {
			var parent = "body",
			$this = $(parent).find("#" + selector);
			
			if ($this.length == 0) {
				var selectorArr = selector.split(".");
				var $wrapper = $('<div id="' + selector + '" class="modal fade" role="dialog" tabindex="-1" aria-labelledby="查看" aria-hidden="false"></div>').append(html);
				$this = $wrapper.appendTo(parent);
				if(hiddenByClick == true){
					$this.modal({
					    backdrop: 'static',
					    keyboard: false
					});
				}
				$this.modal();
				$this.on('hidden.bs.modal', function (e) {
					$this.remove();
				})
			} else {
				$this.empty();
				$this.html(html);
				if(hiddenByClick == true){
					$this.modal({
					    backdrop: 'static',
					    keyboard: false
					});
				}
				$this.modal("show");
			}
		}
	</script>
</body>
</html>


